/**
 * 自定义加密消息处理
 * @param {Object} content
 */
function zdyencryptionMsghandle(content) {
	var str = ''
	str = `<div class="zdy-encryption-div">
			<i class="iconfont icon-mimasuo"></i>
			<span>消息已加密,你无权查看</span>
		</div>`
	return str
}

/**
 * 自定义名片信息处理
 */
function zdycallingCardMsghandle(content) {
	var str = ''
	str = `<div class="zdy-callingCard-div">
			<div class="zdy-callingCard-msg">
				<img class="zdy-callingCard-picture" src="` + content.avatar_url + `"/>
				<p class="zdy-callingCard-name">` + content.user_name + `</p>
				<p class="zdy-callingCard-cell">` + content.phone_no + `</p>
			</div>
			<div class="zdy-callingCard-span">
				<span>个人名片</span>
			</div>
		</div>`
	return str
}

/**
 * 地理位置处理 
 * @param {Object} geo
 */
function zdygeoMsghandle(geo) {
	var Appkey = "73333ae6a6ddd9c186fe6a0e4c71ba9a"
	var str = ''
	str = "<p class='zdy-geoMsg-title'>" + geo.title + "</p>" +
		"<a>" +
		"<img class='zdy-geoImg' src=\"http://restapi.amap.com/v3/staticmap?location=" + geo.lng + "," + geo.lat + "&zoom=10&scale=2&size=360*100&markers=mid,,A:" + geo.lng + "," + geo.lat + "&key=" + Appkey + "\"/>" +
		"</a>"

	return str
}

//zdy地理位置处理
function zdygeoMsg(geo) {
	var str = ""
	var Appkey = "73333ae6a6ddd9c186fe6a0e4c71ba9a"
		//var baseUrl = "http://restapi.amap.com/v3/staticmap/"
	var baseUrl = "http://restapi.amap.com/v3/"
	$.ajax({
		url: baseUrl + "geocode/regeo?key=" + Appkey + "&location=" + geo.lng + "," + geo.lat,
		type: "post",
		data: JSON.stringify(parma),
		contentType: "application/json; charset=utf-8",
		success: function(result) {
			if(result.status === 1) {
				str = str + "<p>" + result.formatted_address + "</p>"
			}
			str = str + "<a>" +
				"<img width=\"100%\" src=\"http://restapi.amap.com/v3/staticmap?location=" + geo.lng + "," + geo.lat + "&key=73333ae6a6ddd9c186fe6a0e4c71ba9a\"/>" +
				"</a>"
		},
		error: function() {
			alert("请求出错");
		}
	}).then(function() {
		return str
	});

}